
#ifndef __BLOOM_H__
#define __BLOOM_H__

class ShaderObject;
class FramebufferObject;
class Renderbuffer;

class cBloom
{
public:
	cBloom(int _w, int _h, unsigned int textureTarget); // window's width and height 
	~cBloom();
	FramebufferObject *sceneFBO;
	void DisplayTexture ();
	void postProcess();
private:
	void DrawQuad (int w, int h, int tw, int th, int texTarget);
	void setFBOProjection (int w, int h);
	void restoreProjection();
	FramebufferObject *downSampleFBO;
	Renderbuffer *rb;
	unsigned int sceneTexId, downSampleTexId, finalCompTexId;
	unsigned int blurHTexId, finalBlurTexId;
	unsigned int texTarget;
	int w,h,wDown, hDown, vp[4];	
	ShaderObject *displayTexRect,*displayTex2D;
	ShaderObject *downSampleShader, *blur;
	ShaderObject *composition;
};

#endif __BLOOM_H__